package messageUtils;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.util.Properties;

public class MessageConfig
{
    private String url;
    private String appUid;
    private String appKey;
    private String contentType;
    
    
    public static MessageConfig getConfig() throws Exception{
        Properties pps = new Properties(); 
        
        pps.load(new BufferedInputStream(new FileInputStream("src\\main\\resources\\config.properties")));
        String url = pps.getProperty("message.url");
        String appUid = pps.getProperty("message.appUid");
        String appKey = pps.getProperty("message.appKey");
        String contentType = pps.getProperty("message.contentType");
        return new MessageConfig(url, appUid, appKey, contentType);
    }


    public MessageConfig(String url, String appUid, String appKey, String contentType)
    {
        
        this.url = url;
        this.appUid = appUid;
        this.appKey = appKey;
        this.contentType = contentType;
    }


    public String getUrl()
    {
        return url;
    }


    public void setUrl(String url)
    {
        this.url = url;
    }


    public String getAppUid()
    {
        return appUid;
    }


    public void setAppUid(String appUid)
    {
        this.appUid = appUid;
    }


    public String getAppKey()
    {
        return appKey;
    }


    public void setAppKey(String appKey)
    {
        this.appKey = appKey;
    }


    public String getContentType()
    {
        return contentType;
    }


    public void setContentType(String contentType)
    {
        this.contentType = contentType;
    }
    
}
